package nix.anim.cms.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import nix.anim.pojo.User;

/**
 * 页面展示Controller
 */
@Controller
public class PageController {

	@RequestMapping("/")
	public String showIndex(Model model, HttpServletRequest request, HttpServletResponse response) {
		// 获取当前用户
		User user = (User) request.getAttribute("currentUser");
		model.addAttribute("currentUser", user);
		return "index";
	}

	@RequestMapping("/cms-site")
	public String showCmsSite() {
		return "cms-site";
	}

	@RequestMapping("/cms-cate")
	public String showCmsCate() {
		return "cms-cate";
	}

	@RequestMapping("/cms-content")
	public String showCmsContent() {
		return "cms-content";
	}
}
